<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="http://apps.bdimg.com/libs/underscore.js/1.7.0/underscore-min.js"></script>
    <script src="http://apps.bdimg.com/libs/zepto/1.1.4/zepto.min.js"></script>
    <script src="http://apps.bdimg.com/libs/backbone.js/1.1.2/backbone-min.js"></script>
</head>
<body>

</body>
<script>
    var _obj = {
        'title':'task1',
        'decriptton':1
    }
    //用backbone使用
    var ToDoItem = Backbone.Model.extend({

    })
    var todoItem = new ToDoItem(_obj)
    todoItem.on('change',function(){
             console.log(this.changed)
            if(this.hasChanged('title')){
                    console.log('title' +'发生变化')
            }else{
                console.log('title' +'没有发生变化')
            }
    })
    //自定义事件
    todoItem.on('abc',function(){
        alert(1)
    })
    //事件触发
    todoItem.trigger('change')

</script>
</html>